<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
	<title>SchemeScript Editing Commands</title>
    <link href="schemescript.css" rel="stylesheet" type="text/css">
</head>

<body>
<h1>Editing</h1>

The SchemeScript editor provides mainly useful editing commands. This section 
summarizes those commands (some of them are also available through
the editor's context menu):

<h2><a name="Commands">Editing commands</a></h2>

<p>
	The editor provides the following commands:
</p>
<table>
	<tr><th>Command</th><th>Description</th><th>Default key sequences</th></tr>
	
	<!-- Movements -->
	<tr class="keycategory"><td colspan="3" align="center" bgcolor="#dddddd"><b>Movement</b></td></tr>
	
	<tr><td class="command">Forward S-expression</td>
		<td>Moves the cursor to the end of the next S-expression.</td>
		<td class="key">ALT-CTRL-F</td>
	</tr>
	<tr><td class="command">Backward S-expression</td>
		<td>Moves the cursor to the beginning of the previous S-expression.</td>
		<td class="key">ALT-CTRL-B</td>
	</tr>
	<tr><td class="command">Up S-expression</td>
		<td>Moves the cursor to the beginning of the enclosing S-expression.</td>
		<td class="key">ALT-CTRL-U</td>
	</tr>
	<tr><td class="command">Down S-expression</td>
		<td>Moves the cursor inside the next list.</td>
		<td class="key">ALT-CTRL-RIGHT_ARROW</td>
	</tr>
	<tr><td class="command">Jump to Definition</td>
		<td>When the cursor is on a symbol corresponding to a globally defined
			variable inside the workspace, this command jumps to the definition
			(which can be in another file).</td>
		<td class="key">F12</td>
	</tr>
	<tr><td class="command">Find Symbol</td>
		<td>Pops up a dialog box that asks for a symbol prefix and displays all matching
			symbols. <i>(Only available in the Scheme Perspective.)</i></td>
		<td class="key">CTRL-F12</td>
	</tr>
	
	<!-- Selection -->
	<tr class="keycategory"><td colspan="3" align="center" bgcolor="#dddddd"><b>Selection</b></td></tr>
	
	<tr><td class="command">Select Forward S-expression</td>
		<td>Adds the next S-expression to the selection.</td>
		<td class="key">ALT-CTRL-SHIFT-F</td>
	</tr>
	<tr><td class="command">Select Backward S-expression</td>
		<td>Adds the previous S-expression to the selection.</td>
		<td class="key">ALT-CTRL-SHIFT-B</td>
	</tr>
	<tr><td class="command">Select Up S-expression</td>
		<td>Selects the enclosing S-expression.</td>
		<td class="key">CTRL-SHIFT-UP_ARROW</td>
	</tr>
		<tr><td class="command">Restore the previous selection</td>
			<td>Used in combination with the previous command. Restores the
				selection that was in effect before selecting the enclosing
				S-expression.</td>
			<td class="key">CTRL-SHIFT-DOWN_ARROW</td>
		</tr>
		
	<!-- Editing-->	
	<tr class="keycategory"><td colspan="3" align="center" bgcolor="#dddddd"><b>Edition</b></td></tr>
	<tr><td class="command">Swap S-expressions</td>
		<td>Swaps the two S-expressions that before and after the current cursor position.</td>
		<td class="key">ALT-CTRL-T</td>
	</tr>
	<tr><td class="command">Format Selection</td>
		<td>Formats the selection, essentially properly indenting the selected lines.</td>
		<td class="key">CTRL-I, CTRL-SHIFT-F, TAB</td>
	</tr>
	<tr><td class="command">Compress Spaces</td>
		<td>Replaces all whitespace characters surrounding the cursor with a single space.</td>
		<td class="key">ALT-CTRL-SPACEBAR</td>
	</tr>
	<tr><td class="command">Mouse Copy</td>
		<td>Copies the S-expression under the mouse position at the cursor position (removing the
			selection, if any). See the <a href="#Mousecopy">Mouse copy section</a>.</td>
		<td class="key">ALT-CTRL-C</td>
	</tr>
	<tr><td class="command">Extended Mouse Copy</td>
		<td>As the <b>Mouse Copy</b> command, but also copies the punctuation characters
			immediately preceding the S-expression, if any (like an opening parenthesis, 
			a quote, an unquote, etc.). See the <a href="#Mousecopy">Mouse copy section</a>.</td>
		<td class="key">ALT-CTRL-X</td>
	</tr>

	<tr><td class="command">Backward Slurp S-expression</td>
		<td>Move the opening parenthesis of the surrounding S-expression one expression to the left.</td>
		<td class="key">ALT-SHIFT-B, S</td></tr>
	<tr><td class="command">Forward Slurp S-expression</td>
		<td>Move the closing parenthesis of the surrounding S-expression one expression to the right.</td>
		<td class="key">ALT-SHIFT-F, S</td></tr>

	<tr><td class="command">Split S-expression</td>
		<td>If the cursor is positioned inside a list, the list is
		    split into two lists.</td>
		<td class="key">ALT-SHIFT-S</td></tr>
	<tr><td class="command">Join S-expressions</td>
		<td>If the cursor is positioned between two lists, the two lists are merged to form 
		    a single list</td>
		<td class="key">ALT-SHIFT-J</td></tr>
	<tr><td class="command">Raise S-expression</td>
		<td>Replace the surrounding S-expression by the S-expression on the right of the cursor.</td>
		<td class="key">ALT-CTRL-SHIFT-R</td></tr>
	<tr><td class="command">Splice S-expression</td>
		<td>If the cursor is positioned inside a list, the list's parentheses are removed.</td>
		<td class="key">CTRL-(</td></tr>
	<tr><td class="command">Wrap S-expression</td>
		<td>Adds parentheses around the S-expression on the right of the cursor.</td>
		<td class="key">CTRL-(</td></tr>

	<tr><td class="command">Kill next S-expression</td>
		<td>Removes the S-expression on the right of the cursor.</td>
		<td class="key">CTRL-K</td></tr>
	<tr><td class="command">Kill previous S-expression</td>
		<td>Removes the S-expression on the left of the cursor.</td>
		<td class="key">CTRL-SHIFT-K</td></tr>
	
	
	<!-- Comments -->
	<tr class="keycategory"><td colspan="3" align="center" bgcolor="#dddddd"><b>Comments</b></td></tr>
	
	<tr><td class="command">Scheme file header comment</td>
		<td>Insert, at the beginning of the file, a file header comment, with the author name,
			and a copyright notice (see the <a href="prefs.html#comments">the comment
		    section in the Scheme preferences</a>).</td>
		<td class="key">ALT-C, H</td>
	<tr><td class="command">Chapter comment</td>
		<td>Insert a chapter-style comment (these comments appear in the Outline View).</td>
		<td class="key">ALT-C, C</td>
	<tr><td class="command">Section comment</td>
		<td>Insert a section-style comment (these comments appear in the Outline View). The section depth
			is determined by the number of <code>*</code> characters in front of the section name. </td>
		<td class="key">ALT-C, S</td>
	<tr><td class="command">Toggle Comment</td>
		<td>Comment out the lines in the selection (or the current line if there is no
			selection) or uncomment the lines if they are already commented out.</td>
		<td class="key">CTRL-/</td>
	</tr>
	
	<!-- Evaluation -->	
	<tr class="keycategory"><td colspan="3" align="center" bgcolor="#dddddd"><b>Evaluation</b></td></tr>
	
	<tr><td class="command"><a name="eval">Start Interpreter</a></td>
		<td>Starts the interpreter, if not already started. 
			<i>(Only available in the Scheme Perspective.)</i></td>
		<td class="key">F9</td>
	<tr><td class="command"><a name="eval">Restart Interpreter</a></td>
		<td>Restarts the interpreter unconditionally, first stopping any
			running interpreter. <i>(Only available in the Scheme 
				Perspective.)</i></td>
		<td class="key">CTRL-F9</td>
	<tr><td class="command"><a name="eval">Eval Expression</a></td>
		<td>Sends the previous S-expression to the Scheme interpreter,
			starting it if necessary.</td>
		<td class="key">CTRL-RETURN</td>
	<tr><td class="command">Eval Toplevel Expression</td>
		<td>Sends the enclosing top-level S-expression to the Scheme interpreter,
			starting it if necessary
			(useful when the cursor is inside a top-level definition and we want
			to send to definition to the interpreter).</td>
		<td class="key">CTRL-SHIFT-RETURN</td>
	<tr><td class="command"><a name="eval">Load File in Interpreter</a></td>
		<td>Loads the current file in the Scheme interpreter,
			starting it if necessary.</td>
		<td class="key">CTRL-SHIFT-L</td>
	</tr>
	<tr><td class="command"><a name="eval">Fast Eval 0</a></td>
		<td>Sends a predefined string to the Scheme interpreter, starting it
			if necessary.</td>
		<td class="key">ALT-k 0</td>
	<tr><td></td><td>...</td><td></td></tr>
	<tr><td class="command"><a name="eval">Fast Eval 9</a></td>
		<td>Sends a predefined string to the Scheme interpreter, starting it
			if necessary.</td>
		<td class="key">ALT-k 9</td>


	<!-- Kawa-specific-->	
	<tr class="keycategory"><td colspan="3" align="center" bgcolor="#dddddd"><b>Kawa-specific</b></td></tr>
	
	<tr><td class="command"><a name="eval">Expand typename</a></td>
		<td>Replaces the symbol located just before the cursor position by 
		    the corresponding Java fully-qualified type name, surrounded by 
		    angle brackets (&lt;<i>fqn</i>&gt;).</td>
		<td class="key">ALT-CTRL-SHIFT-T</td>
	<tr><td class="command"><a name="eval">Expand namespace</a></td>
		<td>Replaces the symbol located just before the cursor position by 
		    a <code>define-namespace</code> form for the corresponding fully-qualified type name.</td>
		<td class="key">ALT-CTRL-SHIFT-N</td>
	<tr><td class="command"><a name="eval">Insert require clause</a></td>
		<td>Adds a <code>require</code> clause for the module that defines the symbol at the
		    cursor position.</td>
		<td class="key">CTRL-SHIFT-M</td>
</table>

<h2><a name="Mousecopy">Mouse copy</a></h2>
<p>
	Mouse copy is a command used to copy S-expressions using the mouse and a key sequence. To "mouse copy" an
	S-expression, you must:
</p>
<ul>
	<li>put the cursor where the S-expression should be copied (or select some text), </li>
	<li>move the mouse over the start or end of the desired S-expression (or simply 
		over it in the case of a string, symbol, constant, etc),</li>
	<li>run either the <b>Mouse Copy</b> or <b>Extended Mouse Copy</b> command (see above).</li>
</ul>


<hr/>
<p>
	Copyright (C) 2004-2006 <b>Dominique Boucher</b>.
</p>
</body>
</html>